//
//  AppDelegate.m
//  GoldPig
//
//  Created by 虎爷 on 2019/10/16.
//  Copyright © 2019 虎爷. All rights reserved.
//

#import "AppDelegate.h"
#import "ZYNetworkAccessibity.h"
#import "GPLoadController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    [ZYNetworkAccessibity setAlertEnable:YES];
    [ZYNetworkAccessibity setStateDidUpdateNotifier:^(ZYNetworkAccessibleState state) {
        NSLog(@"setStateDidUpdateNotifier > %zd", state);
        if (state == 2) {
            [self initWindow];
        }
    }];
    [ZYNetworkAccessibity start];
    
    [self initWindow];

    return YES;
}

-(void)initWindow{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    GPLoadController *vc = [[GPLoadController alloc]init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
    self.window.rootViewController = nav;
}


@end
